import 'package:flutter_test/flutter_test.dart';
import 'package:http_plugin/http_plugin.dart';
import 'package:http_plugin/http_plugin_platform_interface.dart';
import 'package:http_plugin/http_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockHttpPluginPlatform
    with MockPlatformInterfaceMixin
    implements HttpPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final HttpPluginPlatform initialPlatform = HttpPluginPlatform.instance;

  test('$MethodChannelHttpPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelHttpPlugin>());
  });

  test('getPlatformVersion', () async {
    HttpPlugin httpPlugin = HttpPlugin();
    MockHttpPluginPlatform fakePlatform = MockHttpPluginPlatform();
    HttpPluginPlatform.instance = fakePlatform;

    expect(await httpPlugin.getPlatformVersion(), '42');
  });
}
